package com.siderakis.orgunit.client.ui;

import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.uibinder.client.UiRenderer;
import com.siderakis.orgunit.client.domain.OrgUnit;

public class OrgUnitCell extends AbstractCell<OrgUnit> {
  interface MyUiRenderer extends UiRenderer {
    void render(SafeHtmlBuilder sb, String name,String desc);
  }

  private static MyUiRenderer renderer = GWT.create(MyUiRenderer.class);

  @Override
  public void render(Context context, OrgUnit value, SafeHtmlBuilder builder) {
    renderer.render(builder, value.getName(),value.getDescription());
  }

}
